package com.dongni.faithtools

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import com.dongni.tools.Common
import com.dongni.tools.ToastUtils

class MainActivity : AppCompatActivity(),View.OnClickListener {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        findViewById<View>(R.id.mainDateUtilsBtn).setOnClickListener(this)
        findViewById<View>(R.id.zdyToastBtn).setOnClickListener(this)

        Common.log_d("202020","ABC都差点擦掉")

        window.decorView.postDelayed({
            Common.log_d("202020","放到线程中试试...")
        },320)
    }

    /**
     * Called when a view has been clicked.
     *
     * @param v The view that was clicked.
     */
    override fun onClick(v: View?) {
        when (v!!.id) {
            R.id.mainDateUtilsBtn ->{
                Common.log_d("202020","ABCdefg")
                startActivity(Intent(this, DateUtilActivity::class.java))
            }
            R.id.zdyToastBtn ->{
                ToastUtils.showShortToastView(this,"这是自定义提示信息...")
//                ToastUtils.showShortToast(this,"这是自定义提示信息...")
            }
            else -> {

            }
        }
    }
}
